home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef _UserManager_
- #define _UserManager_
-
- #include <Lists.h>
- #include <SerialMgr.h>
-
- /*
-
- © 1988-1992 Spider Island Software
-
- file definition of TeleUsers file
-
- for TeleFinder Group Edition version 2.6
- note: all strings are stored in pascal format
-
- KEY:
-
- < field modified by user manager.
- > field modified by Group Edition Host
-
- */
-
- #define STREET_MAX 50
- #define CITY_MAX 15
- #define STATE_MAX 2
- #define ZIP_MAX 10
- #define V_PHONE_MAX 20
- #define U_NAME_MAX 32
- #define PW_MAX 10
- #define DIALBACK_MAX 40
- #define PATH_MAX 255
-
- typedef struct
- {
- Byte UserName[U_NAME_MAX]; /* < user's logon name */
- long UserID; /* < unused */
- Byte Password[PW_MAX]; /* <> user's password */
- Byte MailPath[256]; /* < full path to the user's mail folder */
- unsigned PrivFlags; /* < bitmap field */
- unsigned DOSFlags; /* < bitmap field */
- int MaxTime; /* <> maximum time allowed */
- int LogonsPerDay; /* < how many times allowed per day */
- int LogonsToday; /* <> how many times logged on today */
- int LogonsMax; /* <> == Time logged on today */
- int MaxIsDaily; /* < time limit type */
- long LastDay; /* <> record time stamp when the day of last logon changes */
- unsigned Priv2Flags; /* < bitmap field added 4/25/90 2 bytes removed from spare_entries */
- int totalCalls; /* <> total calls made to the BBS */
- long totalTime; /* <> total time logged on to the BBS */
- Byte DialBackStr[DIALBACK_MAX]; /* < phone number to dial back at */
- long lastPWchange; /* <> when user last changed his password */
- long lastUpdate; /* <> time of last logon */
- Byte AccessFName[32]; /* < named of file containing users access paths */
- long kb_uploaded; /* <> kb's uploaded by user */
- long kb_downloaded; /* <> kb's downloaded by user */
- long email_sent; /* <> number of email messages sent by user */
- long msgs_posted; /* <> number of messages posted by user */
- long expire_date; /* < date to expire a user record */
- int nextSessionTimeAllowed; /* > calc's by UM AEGetUser, time permitted for next logon */
- int dailyMaximumAllowed; /* > calc's by UM AEGetUser, time permitted for next logon */
- Byte spares[70]; /* reserved */
- Byte spareb; /* reserved */
- Byte VoicePhone[V_PHONE_MAX+1]; /* < users voice phone number */
- long DirID; /* unused */
- int vRef; /* unused */
- } UserRecord, *UserRecPtr, **UserRecHdl;
-
-
- typedef struct
- {
- Byte version;
- long RecSize;
- long NumRecs;
- int modified;
- } UserFileHdr;
-
-
- typedef struct
- {
- UserFileHdr FileHeader;
- Byte fName[65];
- int vRef;
- long DirID;
- UserRecHdl Records[];
- } UserData, *UserPtr, **UserHandle;
-
-
- typedef struct
- {
- Byte UserName[U_NAME_MAX]; /* user's logon name */
- } ListUserRecord, *ListUserRecPtr, **ListUserRecHdl;
-
-
- typedef struct
- {
- UserFileHdr FileHeader;
- Byte fName[65];
- int vRef;
- long DirID;
- ListUserRecHdl Records[];
- } ListUserData, *ListUserPtr, **ListUserHandle;
-
-
- /* Privelege Flags (PrivFlags fields) */
- #define SysOpFlag 0x0001 // all files access
- #define DownLoadFlag 0x0002
- #define TimeLimitFlag 0x0004
- #define ExtAccess 0x0008
-
- #define ChPass 0x0010
- #define DelMail 0x0020
- #define NoFiles 0x0040
- #define PathA ExtAccess
- #define PathB 0x0080
-
- #define ConfAccess 0x0100
- #define PublName 0x0200
- #define PublPhone 0x0400
- #define OnCallBack 0x0800
-
- #define PathC 0x1000
- #define Conf2 0x2000
- #define MakeChgs 0x4000
- #define CannotUpload 0x8000
-
- /* Privelege Flags ( Priv2Flags field ) */
- #define PathD 0x0001
- #define Conf3 0x0002
- #define PathE 0x0004
- #define Conf4 0x0008
- #define Conf5 0x0010
-
- #define DLIsTimeLimited 0x0020
- #define kCanEditSettings 0x0040
- #define kPermanentUserFlag 0x0080
-
- /* DOS preferences */
- #define useMacBinary 0x0001
- #define useCRC 0x0002
-
-
-
- /* Password errors */
- enum {
-
- noPassErr,
- PassNotFound,
- invalidPW,
- PassDiskErr,
- PassPrivErr
-
- };
-
- /* TIME LIMIT OPTIONS (MaxIsDaily field) */
- enum {
- DAILY,
- EACH_LOGON,
- NO_USER_TIME_LIMIT,
- ABSOLUTE_TIME
- };
-
- #define _1_MINUTE_ 60L
- #define _1_HOUR_ (_1_MINUTE_*60L )
- #define _24_HOURS_ (_1_HOUR_*24L )
-
-
- #define _num_day( _time_secs ) ((unsigned long)_time_secs/_24_HOURS_ )
- #define _num_hrs( _time_secs ) ((unsigned long)_time_secs/_1_HOUR_ )
- #define _num_hrs_mins( _time_secs ) ((unsigned long)_time_secs/_1_MINUTE_ )
-
-
- UserHandle GetUsers();
- UserRecHdl CellToUser(), ReadRecordNum();
- Cell GetActiveCell();
- long GetULogonTime(SIO *SIOptr);
- int SaveULogonTime(SIO *SIOptr);
- unsigned long GetLastLogon(SIO *SIOptr);
- int CheckLastLogon(SIO *SIOptr);
- int GetLogonsPerDay(SIO *SIOptr);
- int GetLogonsToday(SIO *SIOptr);
- int UpdateULogonTime(SIO *SIOptr);
- int ShowULogonTime(SIO *SIOptr, int log);
- int UpdateUPass(SIO *SIOptr, Byte *password);
- int SendPassErrMsg(SIO *SIOptr, int PassErr);
- int SetUserTimeToday(SIO *SIOptr, int today_total);
- int GetMaxUserTime(SIO *SIOptr);
- int GetUserTime(SIO *SIOptr);
- int CanUserChPass(SIO *SIOptr);
- int GetUserName(SIO *SIOptr, Byte *theStr);
- int CanUserDelMail(SIO *SIOptr);
- int CanUserMakeChange(SIO *SIOptr);
- int CallUser(SIO *SIOptr);
- int IsUserCallBack(SIO *SIOptr);
- int CanUserDownLoad(SIO *SIOptr, CInfoPBRec *myPB);
- int SendTUserList(SIO *SIOptr, Byte *uName);
- int SendUserInfo(SIO *SIOptr, UserRecHdl theUser);
- UserRecHdl FindPartialUser(Byte *toFind, int *StartAt, int fRefNum, int NumRecs);
- int PBCanTheyDelThis(SIO *SIOptr, HParamBlockRec *theParam);
- int PBCmdPathType(SIO *SIOptr, HParamBlockRec *theParam, int *flags );
- int SetUserDir(SIO *SIOptr, long DirID);
- long UserDirectory(SIO *SIOptr);
- int SetUserVol(SIO *SIOptr, int vRef);
- int UserVol(SIO *SIOptr);
- void AddToUserDLKb( SIO* SIOptr, long k_bytes );
- void AddToUserULKb( SIO* SIOptr, long k_bytes );
- void AddToUserMsgsSent( SIO* SIOptr, long msg_sent );
- void AddToUserMailSent( SIO* SIOptr, long email_sent );
-
- int CanUserUpload(SIO *SIOptr );
- int IsUserDLTimeLimit(SIO *SIOptr );
- int IsUserAllFiles(SIO *SIOptr);
- int IsUserName( SIO* SIOptr, Byte* name );
-
- #endif
-